home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / D51_NARexx / WinCopy.dopus5 < prev    next >
Text File  |  1995-12-26  |  3KB  |  76 lines

  1. /* WinCopy for Directory Opus 5.
  2.  By Leo 'Nudel' Davidson for Gods'Gift Utilities
  3.  email: leo.davidson@keble.oxford.ac.uk  www: http://info.ox.ac.uk/~kebl0364/
  4.  
  5. $VER: WinCopy.dopus5 1.4 (26.12.95)
  6.  
  7.    NOTE: This script _requires_ DOpus v5.11 or above.
  8.    NOTE: DOpusFuncs is an assembler version of this (and other) scripts.
  9.    NOTE: This script does *NOT* do the same thing as Gary Gagnon's
  10.          "CloneSRCE.dopus5" or "same.dopus5", read on...
  11.  
  12.    This script will copy the source lister to the destination lister,
  13.    like the old copywin command in DOpus4.
  14.  
  15.    If you wish to open a _new_ lister which is a copy of the source
  16.    one (as apposed to turning an existing lister into a copy of the
  17.    source), you should use Gary Gagnon's "CloneSRCR.dopus5" script,
  18.    which was included in the official DOpus v5.11 update as
  19.    "DOpus5:ARexx/same.dopus5". Gary's script is also able to clone
  20.    multiple source listers at once.
  21.  
  22. Call as:
  23. ------------------------------------------------------------------------------
  24. ARexx    DOpus5:ARexx/WinCopy.dopus5 {Qp}
  25. ------------------------------------------------------------------------------
  26. Turn off all switches.
  27.  
  28.    v1.01 -> v1.02 - Made "PathOnly" the default behaviour and removed the
  29.                     option to copy the window dimensions (Did anyone want it?).
  30.                     Some minor tidying up.
  31.                     Now checks to make sure the DOPUS.x port exists.
  32.     v1.02 -> v1.3 - Now uses Show() instead of ShowList(). (Thanks Stoebi)
  33.                     Style Guide compliant version numbering and $VER string.
  34.      v1.3 -> v1.4 - Works properly with paths containing spaces, finally.
  35. */
  36.  
  37. options results
  38. options failat 99
  39. signal on syntax;signal on ioerr        /* Error trapping */
  40. parse arg DOpusPort
  41. DOpusPort = Strip(DOpusPort,"B",'" ')
  42.  
  43. If DOpusPort="" THEN Do
  44.     Say "Not correctly called from Directory Opus 5!"
  45.     Say "Load this ARexx script into an editor for more info."
  46.     EXIT
  47.     END
  48. If ~Show("P",DOpusPort) Then Do
  49.     Say DOpusPort "is not a valid port."
  50.     EXIT
  51.     End
  52. Address value DOpusPort
  53.  
  54. lister query source stem source_handle.
  55.  
  56. IF source_handle.count = 0 | source_handle.count = "SOURCE_HANDLE.COUNT" Then Do
  57.     dopus request '"You must have a SOURCE lister!" OK'
  58.     EXIT
  59.     End
  60.  
  61.  
  62. lister query dest stem dest_handle.
  63.  
  64. IF dest_handle.count = 0 | dest_handle.count = "DEST_HANDLE.COUNT" Then Do
  65.     dopus request '"You must have a DESTINATION lister!" OK'
  66.     EXIT
  67.     End
  68.  
  69.  
  70. lister query source_handle.0 path
  71. source_path = RESULT
  72. lister read dest_handle.0 '"'||source_path||'"'
  73.  
  74. syntax:;ioerr:                /* In case of error, jump here */
  75. EXIT
  76.